<?php 
namespace app\admin\controller;


use app\admin\service\DeviceBindService;

/**
* 设备绑定管理-控制器
* Class DeviceBind
*/
class DeviceBind extends Backend
{

    public function initialize()
    {
        parent::initialize();
        $this->service = new DeviceBindService();
    }

    public function stuedit()
    {
        $result = $this->service->stuedit();
        return $this->jsonReturn($result);
    }

    // 设备绑定新增
    public function add()
    {
        $result = $this->service->add($this->userId);
        return $this->jsonReturn($result);
    }

    // 设备IMEI换绑
    public function change()
    {
        $result = $this->service->change($this->userId);
        return $this->jsonReturn($result);
    }

    // 设备绑定解除
    public function del()
    {
        $result = $this->service->del($this->userId);
        return $this->jsonReturn($result);
    }

    public function updateDefaultShow()
    {
        $result = $this->service->updateDefaultShow($this->userId);
        return $this->jsonReturn($result);
    }

    public function setDevicePhone()
    {
        $result = $this->service->setDevicePhone($this->userId);
        return $this->jsonReturn($result);
    }

    public function getDevicePhone()
    {
        $result = $this->service->getDevicePhone($this->userId);
        return $this->jsonReturn($result);
    }
}

